part of '../widgets.dart';

/// [VanOverlay]属性常量
const kVanOverlayBackground = VanCssKey._raw('--van-overlay-background');

class VanOverlay extends StatelessWidget {
  final VoidCallback? onClick;

  const VanOverlay({super.key, this.onClick});

  @override
  Widget build(BuildContext context) {
    Widget child0 = Container(
      color: kVanOverlayBackground.toColor(context),
      width: double.infinity,
      height: double.infinity,
    );
    if (onClick != null) {
      child0 = Material(
        color: Colors.transparent,
        child: InkWell(
          onTap: onClick,
          splashColor: Colors.transparent,
          enableFeedback: false,
          child: child0,
        ),
      );
    }
    return child0;
  }
}
